<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<body>
	<ui:composition>
		<p:panel id="panelPesquisa">
			<f:facet name="header">
				<h:outputText value="#{lbls.LBL_0017}" />
			</f:facet>

			<table cellpadding="0" cellspacing="10" border="0">
				<tr>
					<td colspan="2">
						<div style="width: 420px;">
							<h:outputLabel for="txtCompraNome2" value="#{lbls.LBL_0010}" />
							<p:inputText value="#{manterTransacaoMB.entidade.descricao}"
								id="txtCompraNome2" label="#{lbls.LBL_0010}" style="width:410px;" />
						</div>
					</td>
				</tr>
				<tr>
					<td align="right">
						<p:commandButton value="#{lbls.LBL_0078}" id="btnPesquisar"
							icon="ui-icon-search" process="@this txtCompraNome2" update="panelPesquisa"
							action="#{manterTransacaoMB.doPesquisarAction}" />
					</td>
				</tr>
			</table>

			<div align="right">
				<p:commandButton value="#{lbls.LBL_0009}" id="btnAdicionar"
					icon="ui-icon-circle-plus" process="@this" update="@form"
					action="#{manterTransacaoMB.doAdicionarAction}" />
			</div>

			<p:spacer height="10" />
			<p:dataTable id="transacaoDataTable" var="transacao" paginator="true"
				rows="5" emptyMessage="#{lbls.LBL_0004}" paginatorPosition="bottom"
				rowKey="#{transacao.id}" value="#{manterTransacaoMB.listaTransacoes}"
				paginatorAlwaysVisible="false"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
				<p:column style="width:10px;">
					<div align="center">
						<h:outputText value="#{transacao.id}" />
					</div>
				</p:column>

				<p:column>
					<h:outputText value="#{transacao.descricao}" />
				</p:column>

				<p:column style="width:40px">
					<p:commandButton id="selectButton"
						action="#{manterTransacaoMB.doDetalharAction}" icon="ui-icon-search"
						update="@form" title="Visualizar">
						<f:setPropertyActionListener value="#{transacao}"
							target="#{manterTransacaoMB.entidade}" />
					</p:commandButton>
				</p:column>

				<p:column style="width:40px">
					<p:commandButton id="showDialogButton" icon="ui-icon-trash"
						onclick="confirmation.show()">
						<f:setPropertyActionListener value="#{transacao}"
							target="#{manterTransacaoMB.entidade}" />
					</p:commandButton>

				</p:column>

			</p:dataTable>

			<div align="right" style="margin-top: 10px;">
				<p:commandButton value="#{lbls.LBL_0009}" id="btnAdicionar2"
					icon="ui-icon-circle-plus" process="@this" update="@form"
					action="#{manterTransacaoMB.doAdicionarAction}" />
			</div>

			<p:confirmDialog id="confirmDialog" message="#{msgs.MSG_0002}"
				header="#{msgs.MSG_0003}" severity="alert" appendToBody="true"
				widgetVar="confirmation">

				<p:commandButton value="#{lbls.LBL_0011}" process="@this"
					oncomplete="confirmation.hide()" update="transacaoDataTable"
					action="#{manterTransacaoMB.doRemoverAction}" />

				<p:commandButton id="decline" value="#{lbls.LBL_0012}"
					onclick="confirmation.hide()" type="button" />
			</p:confirmDialog>

		</p:panel>
	</ui:composition>
</body>
</html>

